import request from "@/api/request.js";

export const getAllTempService = () => {
  return request.get("/api-self/inspection/template");
};

export const getTempDetService = dataObj => {
  let url = `/api-self/inspection/template/detail/${dataObj.inspectionId}/${dataObj.inspectionMapId}`;
  return request.get(url);
};

//查看分配的巡检任务
export const getAllAssService = dataObj => {
  let url = `/api-self/inspection/${dataObj.userId}`;
  return request.get(url);
};

//查询分配的巡检任务详情
export const getAssDeService = dataObj => {
  let url = `/api-self/inspection/detail/${dataObj.inspectionWorkId}/${dataObj.userId}`;
  return request.get(url);
};

export const delTempService = dataObj => {
  let url = `/api-self/inspection/template/${dataObj.inspectionId}`;
  return request.delete(url);
};

export const editTempService = dataObj => {
  let url = `/api-self/inspection/template/${dataObj.inspectionId}`;
  return request.put(url, dataObj.data);
};

//删除分配的巡检任务
export const delAssTasService = dataObj => {
  let url = `/api-self/inspection/${dataObj.inspectionWorkId}`;
  return request.delete(url);
};

//分配
export const assTaskService = dataObj => {
  return request.post("/api-self/inspection/distribute", dataObj);
};

export const addTempServcie = dataObj => {
  return request.post("/api-self/inspection/template", dataObj);
};
